package com.example.module_motocircle.post

import androidx.recyclerview.widget.DiffUtil
import com.example.module_motocircle.model.PostItem

class PostDiffCallBack(val oldData: List<PostItem>,val newData: List<PostItem>): DiffUtil.Callback() {
    override fun getOldListSize(): Int {
       return oldData.size
    }

    override fun getNewListSize(): Int {
        return newData.size
    }

    override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return oldData[oldItemPosition].posts_id == newData[newItemPosition].posts_id
    }

    override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return oldData[oldItemPosition] == newData[newItemPosition]
    }

//    override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? {
//        val old = oldData[oldItemPosition]
//        val new  = newData[newItemPosition]
//
//    }

}